#include "stdio.h"
#include "stdlib.h"
int ways(int stairs) {
  /*  if (stairs == 0) {
        return 1;
    }
    if (stairs < 0) {
        return 0;
    }
  if(stairs == 1) {
    return 1;
  }
  if(stairs == 2) {
    return 2;
  }
    return ways(stairs - 1) + ways(stairs - 2);
*//* */
  int *ways = (int *)malloc((stairs + 1) * sizeof(int));
  if(ways == NULL) {
    fprintf(stderr, "Memory allocation failed\n");
    exit(1);
  }
  int index=0;
  for(;index <= stairs; index++) {
    if(index == 0) {
      ways[index] = 1;
    } else if(index == 1) {
      ways[index] = 1;
    } else if(index == 2) {
      ways[index] = 2;
    } else {
      ways[index] = ways[index - 1] + ways[index - 2];
    }
  }
  return ways[stairs];
}

int main(int argc, char *argv[]) {
  int stairs;
  if(argc != 2) {
    fprintf(stderr, "Usage: %s <number of stairs>\n", argv[0]);
    return 1;
  }
  if(sscanf(argv[1], "%d", &stairs) != 1) {
    fprintf(stderr, "Invalid number of stairs: %s\n", argv[1]);
    return 1;
  }
  printf("%d\n",ways(stairs));
  
    return 0;
}
